package com.zhm.demo.feign;

import com.zhm.base.TestReq;
import feign.Feign;
import feign.Logger;
import feign.codec.Decoder;
import feign.codec.Encoder;
import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder;
import feign.slf4j.Slf4jLogger;

public class TestFeignBuilder {

    public static void main(String[] args) {
        DataFeignClient dataFeignClient = Feign.builder()
                .logger(new Logger.JavaLogger("ttt"))
                .logger(new Slf4jLogger())
                .logLevel(Logger.Level.FULL)
                .encoder(new GsonEncoder())
                .decoder(new GsonDecoder())
                .target(DataFeignClient.class, "http://localhost:8788");

        TestReq testReq = new TestReq();
        testReq.setA("a");

        String add = dataFeignClient.add(testReq);
        System.out.println(add);
    }
}
